package edu.zjut.hjg.saas.biz.model;

import edu.zjut.hjg.saas.biz.support.RoleName;

/**
 * 幼儿园网站用户模型
 *
 * @author hjg
 */
public class User {
    private Integer      id;
    private Kindergarten kindergarten = new Kindergarten();
    private String       loginId;
    private String       password;
    private RoleName     roleName;
    private String       name;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Kindergarten getKindergarten() {
        return kindergarten;
    }

    public void setKindergarten(Kindergarten kindergarten) {
        this.kindergarten = kindergarten;
    }

    public String getLoginId() {
        return loginId;
    }

    public void setLoginId(String loginId) {
        this.loginId = loginId;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public RoleName getRoleName() {
        return roleName;
    }

    public void setRoleName(RoleName roleName) {
        this.roleName = roleName;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public boolean isAdmin() {
        return this.roleName == RoleName.ADMIN;
    }

    @Override
    public String toString() {
        return "User [id=" + id + ", kindergarten=" + kindergarten + ", loginId=" + loginId
                + ", name=" + name + ", password=" + password + ", roleName=" + roleName + "]";
    }
}
